<?php
$session=new CHttpSession();
$session->open();
$i=$session['i'];

if(!empty($data)) {
    $n=$i%4;
//    $user=Users::model()->with('p')->findByPk($data->uid);
    if(mb_strlen($data->p->nickname, 'UTF-8')>17){
           $cname= mb_substr($data->p->nickname,0,16,'UTF-8').'…';
    }else{
            $cname=  $data->p->nickname;
    }
//    if(mb_strlen($data->title, 'UTF-8')>8){
//        $ctitle= mb_substr($data->title,0,7,'UTF-8').'…';
//    }else{
//        $ctitle=  $data->title;
//    }


    echo '<li class="t0'.(($n>5)?' next':'').'"><a href="'.Yii::app()->createUrl('job/company', array('uid'=>$data->id)).'" title="'.$data->p->nickname.'">'.$cname.'</a></li>';
}

$session['i']=$i+1;
?>